﻿$.using("kxtx.core");

kxtx.core.exception = function (cfg) {
    var config = {
        message: null,
        type: "error",
        userFriendlyInfo: null,
        technicalInfo: null,
        timeout:-1
    };

    this.getMessage = function () {
        return config.message;
    }
    this.getType = function () {
        return config.type;
    }
    this.getUserFriendlyInfo = function () {
        return config.userFriendlyInfo;
    }
    this.getTechnicalInfo = function () {
        return config.technicalInfo;
    }
    this.getTimeout = function () {
        return config.timeout;
    }


    if (typeof cfg == "string") {
        config.message = cfg;
    }
    else if (typeof cfg == "object") {
        config = $.extend(config, cfg);
    }
};
